#ifndef __SCROLL__HPP__
#define __SCROLL__HPP__
#include "Ielement.hpp"


enum ScrollOrientation
{
	Vertical = 1,
	Horizontal
};

class Scroll :
	public IElement
{
public:
	Scroll(IElement*, SDL_Surface*,ScrollOrientation);
	virtual ~Scroll(void);

	void SetLength(int);
	void SetPos(int);

private:

	//Ielement interface
	void update();
	void render(int x, int y);
	
	void onResize();
	void onMove();

	bool mouseUp(int x, int y, Uint8 button);
	bool mouseDown(int x, int y, Uint8 button);
	//-------

	ScrollOrientation orientation_;
	int length_;
	int cur_;

	int barLen_;
	int barStart_;
	Uint32 curBarColor_;

	void recalcBar();

};

#endif